package Main;

import book.BookList;
import user.AdiminalUser;
import user.NomalUser;
import user.User;

import java.util.Scanner;

public class Main {
    public static  User login()
    {

            System.out.println("请输入你的名字：");
            Scanner in = new Scanner(System.in);
            String name = in.nextLine();
                System.out.println("请输入你的身份：1.管理员 2.普通用户");
                int b = in.nextInt();
                if (b == 1) {
                    return new AdiminalUser(name);//返回一个对象要new
                } else {
                    return new NomalUser(name);
                }

    }
    public static void main(String[]args){
        User user1 = login();//用父类什么都可以接收
        BookList book1 = new BookList("书名示例", 1, "作者", "类型", 3,"未借出");
        while (true) {
            int c = user1.meau();
            user1.does(c, book1);
        }
    }
}
